package models

import "gorm.io/gorm"

type Real struct {
	gorm.Model
	UserId   int    `gorm:"type:int;not null;comment:'用户id'"`
	AuthName string `gorm:"type:varchar(10);unique;not null;comment:'真实姓名'"`
	IDCard   string `gorm:"type:char(18);not null;comment:'身份证号'"`
}

func (r *Real) GetReal(userId int) error {
	return DB.Debug().Where(userId).Limit(1).Find(&r).Error
}

func (r *Real) CreateRealName() error {
	return DB.Debug().Create(&r).Error
}
